<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>设置内容和属性</title>
    <script src="../../lib/jquery-3.4.1.js"></script>
    <style>


    </style>
</head>
<body>

<div id="div1" style="width: 100%;height: 200px;background-color: lightyellow"></div>
<div id="div2" style="width: 100%;height: 200px;background-color: yellowgreen"></div>
<input placeholder="xingweixin" id="iput1"><br>
<a id="ax1">点我跳转</a>

<hr>
<button id="btn1">点击设置文字</button>
<button id="btn2">点击设置HTML</button>
<button id="btn3">点击设置input的值</button>
<button id="btn4">设置跳转链接</button>
<button id="btn5">设置多个属性</button>


<script>

    $("#btn1").click(function () {

        $("#div1").text("邢伟新");
    });

    $("#btn2").click(function () {

        $("#div2").html("<b>hello world</b>");
    })

    $("#btn3").click(function () {

        $("#iput1").val("妈的,还有谁");

    })

    $("#btn4").click(function () {

        $("#ax1").attr("href","https://www.baidu.com/");

    })

    $("#btn5").click(function () {

        $("#ax1").attr({"href" : "https://www.baidu.com/",
            "title" : "jQuery教程",
            "background-color" :"red"});

    })




</script>







</body>
</html>